#include "stdafx.h"
#include <serialization/ioParamStructs.h>
#include <serialization/serialization.h>
#include <winsock/winsock_stub.h>

void select_stub (
    __in  std::vector<char>& in_buf,
    __out std::vector<char>& out_buf
    )
{
//RECEIVE()
    Deserialize deserialize (in_buf);
    select_in_inout selectIN;
    deserialize (selectIN);

    int ret = select ( selectIN.nfds_, selectIN.readfds_,
        selectIN.writefds_, selectIN.exceptfds_,
        selectIN.timeout_ );
//SEND
    select_out_inout selectOUT( ret, selectIN.readfds_,
        selectIN.writefds_, selectIN.exceptfds_, WSAGetLastError() );
    
    Serialize(deserialize.get_header(), selectOUT, out_buf);
}